/*
    sqlite.me -- MakeMe file for SQLite
 */

Me.load({
    targets: {
        sqlite: {
            configurable: true,
            depends: [ 'libsql' ],
        },

        libsql: {
            type: 'lib',
            headers: [ '*.h' ],
            sources: [ 'sqlite3.c' ],
            '-compiler': [
                '-Wall',
                '-Wshorten-64-to-32',
                '-Wunreachable-code',
            ],
            scripts: {
                '+precompile': `
                    if (me.targets.compiler.path.basename == 'gcc') {
                        me.target.compiler.push('-w')
                    } else if (me.targets.compiler.path.basename == 'clang') {
                        me.target.compiler.push('-w')
                    }
                `,
            },
            ifdef: [ 'sqlite' ],
        },

        sqliteshell: {
            path: '${BIN}/sqlite${EXE}',
            type: 'exe'
            sources: [ 'sqlite.c' ],
            depends: [ 'libsql' ],
            platforms: [ 'local' ],
            ifdef: [ 'sqlite' ],
            generate: false,
        },
    },
})
